package code_smells

// 过度评论 excessive comments

// Excessive comments
func outputOrderedPeopleA(in []*Person) {
    // This code orders people by name.
    // In cases where the name is the same, it will order by phone number.
    // The sort algorithm used is a bubble sort
    // WARNING: this sort will change the items of the input array
    /*

        这个代码是按人名排列的。
    在名称相同的情况下，它将按电话号码排序。
    所使用的排序算法是冒泡排序。
    警告：此类将更改输入数组的项。

    */
    for range in {
        // ... sort code removed ...

    }
    outputPeople(in)
}

// Person data object
type Person struct {
    Name  string
    Phone string
}

// Comments replaced with descriptive names 用描述性名称替换的注释
func outOrderedPeopleB(in []*Person) {
    sortPeople(in)
    outputPeople(in)

}

func outputPeople(in []*Person) {
    // todo

}

// any special instructions that MUST be documented relating to the sort should go here
// 任何与此分类有关的特殊指令都应该在这里。
func sortPeople(in []*Person) {
    // todo

}
